The present invention relates to a cache control program.
A plurality of client machines are connected to a network system. A file server is connected to the network system to share files. A client machine accesses the file server to use programs and data generated by other client machines. Due to progress in the client machine capability, there is a demand for increasing the speed for accessing files, or increasing the file server capability.
FIG. 1 is a diagram showing the concept of file recording by a file server 1.
The file server 1 includes a disk device 2. A plurality of files 3 are stored in the disk device 2. The disk device 2 manages the recorded data in a predetermined number of blocks. The file server 1 divides a file 3 into a plurality of blocks 4, each including a predetermined amount of data, and manages the position of each block 4 with recording position information. In response to a request from a client machine, the file server 1 sends a file 3, which includes plural blocks 4, to the client machine. The file server 1 then divides the file received from the client machine into a plurality of blocks and stores the blocks in the disk device 2.
The file server 1 is provided with a cache manager for responding to data access at high speed. The cache manager copies files accessed by the client machine into a memory having an input/output speed that is higher than that of the disk device 2. Subsequently, when the file 3 stored in the disk device 2 is accessed, the cache manager reads the copy of the file 3 stored in its memory and provides the copy to the client machine.
FIG. 2 schematically shows the file server 1. The file server 1 includes a communication control manager 11, a page cache manager 12, a file system 13, a buffer cache manager 14, and a block device 15. The communication control manager 11 includes a communication buffer 16, which is required for data transfer with the client machine 5. The page cache manager 12 and the buffer cache manager 14 include cache memories 17 and 18, respectively.
The page cache manager 12 improves the input/output efficiency of the file 3 by the client machine 5. The buffer cache manager 14 improves the input/output efficiency of the blocks 4 by the disk device 2.
The file 3 transferred from the client machine 5 is stored in the disk device 2 via the communication buffer 16 and the two cache memories 17 and 18. More specifically, the communication control manager 11 receives the file 3 transmitted from the client machine 5 and stores the file 3 in the communication buffer 16. The file system 13 manages the file 3 with information such as a file ID. The page cache manager 12 stores the blocks 4 configuring the file 3 in the cache memory 17. Each block 4 is associated with its file ID and an offset, which indicates its stored position.
The file system 13 has a section for storing files in the disk device 2. The block device 15 accesses the designated disk device 2 in blocks. The buffer cache manager 14 stores the blocks that are to be stored in the disk device 2 in the cache memory 18. Each block 4 is associated with the device ID of the disk device 2 and an offset, which indicates the position of the block in the disk device 2.
The position for accessing the file server 1 will now be discussed with reference to FIG. 3. In response to an access request for a file 3, the file server 1 accesses a block 4 configuring the file 3 stored in the cache memory 17 in accordance with the file ID and the offset.
When the block is not stored in the cache memory 17, the file server 1 accesses the disk device 2, reads the block 4 from the disk device 2, and stores the block 4 in the cache memory 18 of the buffer cache manager 14 and the cache memory 17 of the page cache manager 12. The file server 1 provides the read block 4 to the client machine 5. Then, the buffer cache manager 14 associates the read block 4 with the stored cache memory 18 and the stored section of the disk device 2. The page cache manager 12 associates the block 4 stored in the cache memory 17 with a section of a file.
The file server 1 of the prior art requires the two cache memories 17 and 18 that store substantially the same blocks 4. Thus, the file server 1 requires a cache memory having a cache memory capacity that is greater than (by two times) the cache memory capacity indicated in a specification.
Further, the information stored in the two cache memories 17 and 18 must be substantially the same. Thus, data must be copied for the cache memories 17 and 18. Further, data must be copied in the same manner in the cache memory 17, which is managed by the page cache manager 12, and the communication buffer 16. The copying of cache data results in load that delays the input/output characteristics (response speed) of the file server 1.